import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TeachStandardVO, TeachStandardForm, TeachStandardQuery } from '@/api/core/teachStandard/types';

/**
 * 查询实验教学标准列表
 * @param query
 * @returns {*}
 */

export const listTeachStandard = (query?: TeachStandardQuery): AxiosPromise<TeachStandardVO[]> => {
  return request({
    url: '/core/teachStandard/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询实验教学标准详细
 * @param id
 */
export const getTeachStandard = (id: string | number): AxiosPromise<TeachStandardVO> => {
  return request({
    url: '/core/teachStandard/' + id,
    method: 'get'
  });
};

/**
 * 新增实验教学标准
 * @param data
 */
export const addTeachStandard = (data: TeachStandardForm) => {
  return request({
    url: '/core/teachStandard',
    method: 'post',
    data: data
  });
};

/**
 * 修改实验教学标准
 * @param data
 */
export const updateTeachStandard = (data: TeachStandardForm) => {
  return request({
    url: '/core/teachStandard',
    method: 'put',
    data: data
  });
};

/**
 * 删除实验教学标准
 * @param id
 */
export const delTeachStandard = (id: string | number | Array<string | number>) => {
  return request({
    url: '/core/teachStandard/' + id,
    method: 'delete'
  });
};
